package com.ruoyi.legal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.page.Pages;
import com.ruoyi.common.core.page.Query;
import com.ruoyi.common.query.QueryTool;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.legal.mapper.PackYstzMapper;
import com.ruoyi.legal.domain.PackYstz;
import com.ruoyi.legal.service.IPackYstzService;

/**
 * 移送台账备份Service业务层处理
 * 
 * @author xwj
 * @date 2025-05-11
 */
@Service
public class PackYstzServiceImpl extends ServiceImpl<PackYstzMapper, PackYstz> implements IPackYstzService {
    @Autowired
    private PackYstzMapper packYstzMapper;

    /**
     * 查询移送台账备份
     * 
     * @param id 移送台账备份主键
     * @return 移送台账备份
     */
    @Override
    public PackYstz selectPackYstzById(Long id) {
        return packYstzMapper.selectPackYstzById(id);
    }

    /**
     * 查询移送台账备份列表
     * 
     * @param packYstz 移送台账备份
     * @return 移送台账备份
     */
    @Override
    public List<PackYstz> selectPackYstzList(PackYstz packYstz) {
        return packYstzMapper.selectPackYstzList(packYstz);
    }

    /**
     * 新增移送台账备份
     * 
     * @param packYstz 移送台账备份
     * @return 结果
     */
    @Override
    public PackYstz insertPackYstz(PackYstz packYstz) {

      //  packYstzMapper.insertPackYstz(packYstz);
    save(packYstz);
    return packYstz;
    }

    /**
     * 修改移送台账备份
     * 
     * @param packYstz 移送台账备份
     * @return 结果
     */
    @Override
    public PackYstz updatePackYstz(PackYstz packYstz) {

      //  packYstzMapper.updatePackYstz(packYstz);
        updateById(packYstz);
        return packYstz;
    }

    /**
     * 批量删除移送台账备份
     * 
     * @param ids 需要删除的移送台账备份主键
     * @return 结果
     */
    @Override
    public int deletePackYstzByIds(Long[] ids) {
        return packYstzMapper.deletePackYstzByIds(ids);
    }

    /**
    * 条件删除
    * @param packYstz 移送台账备份
    * @return
    */
    @Override
    public int delete(PackYstz packYstz) {
        QueryWrapper<PackYstz> qw = new QueryWrapper<>();
        QueryTool.condition(qw, packYstz);
        return baseMapper.delete(qw);
    }

    /**
     * mp分页
     * @param packYstz 移送台账备份
     * @return
     */
    @Override
    public Pages<PackYstz> queryPage(PackYstz packYstz) {
        QueryWrapper<PackYstz> qw = new QueryWrapper<>();
        QueryTool.condition(qw, packYstz);
        IPage<PackYstz> ipage = new Query<PackYstz>().getPage(packYstz);

        IPage<PackYstz> page = this.page(
                ipage,
                qw
        );
        return new Pages<>(page);
    }

    @Override
    public void deleteByPackIds(Long[] ids) {
         baseMapper.deleteByPackIds(ids);
    }

    /**
     * 删除移送台账备份信息
     * 
     * @param id 移送台账备份主键
     * @return 结果
     */
    @Override
    public int deletePackYstzById(Long id) {
        return packYstzMapper.deletePackYstzById(id);
    }
}
